package com.qf.util;

/**
 * --- 年薪百万 ---
 * ---So easy---
 *
 * @author ZhiHuiJun
 * @motto 学习都是人上人
 * @desc 就是很帅很优秀
 */
public class R {
    private String code;
    private String msg;
    private Object data;

    public static R ok() {
        return new R("20000","成功");
    }

    public static R ok(String code) {
        return new R(code,"成功");
    }

    public static R ok(String code,String msg) {
        return new R(code,msg);
    }

    public static R ok(Object data) {
        return new R("20000","成功",data);
    }

    public static R ok(String code,String msg,Object data) {
        return new R(code,msg,data);
    }

    public static R fail() {
        return new R("500","失败");
    }

    public static R fail(String msg) {
        return new R("500",msg);
    }

    public R() {
    }

    public R(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public R(String code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
